using System;
using System.Collections.Generic;
using System.Text;

namespace Barbar.MapReport.PolygonReducer {
  internal class PointRef : IComparable<PointRef> {
    public string PolygonId;
    public int PolylineIndex;
    public long Index;

    public PointRef(string polygonId, int polylineIndex, long index) {
      PolygonId = polygonId;
      PolylineIndex = polylineIndex;
      Index = index;
    }

    #region IComparable<PointRef> Members

    public int CompareTo(PointRef other) {
      if (PolygonId == other.PolygonId) {
        if (PolylineIndex == other.PolylineIndex)
          return Index.CompareTo(other.Index);
        else
          return PolylineIndex.CompareTo(other.PolylineIndex);
      }
      return String.Compare(PolygonId, other.PolygonId, StringComparison.OrdinalIgnoreCase);
    }

    #endregion
  }
}
